<template>
	<view>
		<view class="head_swiper"><u-swiper height="300" :autoplay="false" :list="swiper_list" mode="rect" indicator-pos="bottomCenter" :border-radius="0"></u-swiper></view>
		<view class="content"><u-parse :html="share.content" :use-cache="true" :lazy-load="true" :show-with-animation="true" :selectable="true" :tag-style="style"></u-parse></view>
	</view>
</template>

<script>
import { open_code } from '@/api/index.js';
export default {
	data() {
		return {
			swiper_list: [],
			style: {
				p: 'text-indent: 2em;',
				h2: 'text-align: center;padding: 25rpx 0;',
				h3: 'text-align: center;color:red'
			}
		};
	},
	onLoad() {
		this.getList();
	},
	methods: {
		async getList() {
			await open_code('lunbo').then(res => {
				console.log(res, '获取轮播图');
				this.swiper_list = res.data.map(item => item.content);
			});
			await open_code('school_about').then(res => {
				console.log(res, '获取学校信息');
				this.share = res.data[0];
				this.$set_title(res.data[0].title);
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.content {
	padding: 0 25rpx 35rpx;
}
</style>
